package com.android.googleservice;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

public class NetworkReceiver extends BroadcastReceiver {
	private OnNetworkListener listener;

	@Override
	public void onReceive(Context context, Intent intent) {
		boolean isConnect = Utilities.isConnectingToInternet(context);
		if (isConnect) {
			//hideNotification();
			if(listener != null){
				listener.onOnline();
			}
		} else {
			if(listener != null){
				listener.onOffine();
			}
			//AnoChatSocket.getInstance(context).disconnect();
			//showNotification();
		}

	}
	public void setOnNetworkListener(OnNetworkListener listener){
		this.listener = listener;
	}
	public interface OnNetworkListener{
		void onOnline();
		void onOffine();
	}
}
